//
//  RoadMapViewController.m
//  ASHT_IOS
//
//  Created by 宋安安 on 14-4-18.
//  Copyright (c) 2014年 宋安安. All rights reserved.
//

#import "RoadMapViewController.h"

@interface RoadMapViewController ()

@end

@implementation RoadMapViewController
@synthesize roadmapDelegate;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    btn_Walk.selected=YES;
    self.lab_Name.text=self.bmkpoiinfo.name;
    self.lab_Address.text=self.bmkpoiinfo.address;
    self.lab_Phone.text=self.bmkpoiinfo.phone;
    self.text_end.text=self.bmkpoiinfo.name;
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(IBAction)btn_Bus_OnClick:(id)sender;
{
    btn_Bus.selected=YES;
    btn_Drive.selected=NO;
    btn_Walk.selected=NO;
}
-(IBAction)btn_Walk_OnClick:(id)sender
{
    btn_Bus.selected=NO;
    btn_Drive.selected=NO;
    btn_Walk.selected=YES;
}
-(IBAction)btn_Drive_OnClick:(id)sender;
{
    btn_Bus.selected=NO;
    btn_Drive.selected=YES;
    btn_Walk.selected=NO;
}
-(IBAction)btn_btn4_OnClick:(id)sender
{
    NSString *str= self.text_star.text;
    self.text_star.text=self.text_end.text;
    self.text_end.text=str;
    CLLocationCoordinate2D cc2d=self.star;
    self.star=self.end;
    self.end=cc2d;
}
-(IBAction)btn_Routeplaning_OnClick:(id)sender
{
    if (btn_Bus.selected) {
        NSLog(@"公交");
        [roadmapDelegate BusRoutePlanning :self.star end:self.end];
        [self.app.viewDeckController.navigationController popViewControllerAnimated:YES];
    }
    else if(btn_Walk.selected)
    {
        NSLog(@"步行");
        [roadmapDelegate WalkingRoutePlanning :self.star end:self.end];
        [self.app.viewDeckController.navigationController popViewControllerAnimated:YES];
    }
    else if (btn_Drive.selected)
    {
        NSLog(@"驾车");
        [roadmapDelegate DriveRoutePlanning :self.star end:self.end];
        [self.app.viewDeckController.navigationController popViewControllerAnimated:YES];
        
    }
}

@end
